import Vue from "vue";
import Router from "vue-router";
// import {
//     component
// } from "vue/types/umd";
import grandPage from '@/content/views/Main'
Vue.use(Router);
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
    return originalPush.call(this, location).catch(err => err)
}

export default new Router({
    routes: [{
        path: "/login",
        name: "login",
        component: require("@/content/views/login/index1").default,
    },
    {
        path: "/",
        name: "grandPage",
        redirect: '/index/home'
    },
    {
        path: '/index',
        name: 'index',
        component: grandPage,
        children: [
            {
                path: 'home',
                name: 'home',
                component: require("@/content/views/home/Index").default,
                meta: { keepAlive: true }
            },
            {
                path: 'cloud',
                name: 'cloud',
                component: require("@/content/views/cloud/Index").default,
                // meta: { keepAlive: true }
            }
        ]
    },
    {
        path: '/index',
        name: 'index',
        component: grandPage,
        children: [{
            path: 'person',
            name: 'person',
            redirect: { name: "initial" },
            component: require("@/content/views/person/Index").default,
            children: [{
                path: 'initial',
                name: 'initial',
                component: require("@/content/views/person/person_mesage/initial").default,
                // meta:{keepAlive:true,},
            },
            {
                path: 'space',
                name: 'space',
                component: require("@/content/views/person/person_mesage/space").default,
            },
            {
                path: 'change',
                name: 'change',
                component: require("@/content/views/person/person_mesage/changepassword").default,
            },
            {
                path: 'point',
                name: 'point',
                component: require("@/content/views/person/person_mesage/Point").default,
            },
            {
                path: 'setting',
                name: 'setting',
                component: require("@/content/views/person/person_mesage/Setting").default,
            },
            {
                path: 'about',
                name: 'about',
                component: require("@/content/views/person/person_mesage/about").default,
            },
            {
                path: 'import',
                name: 'import',
                component: require("@/content/views/person/person_mesage/import").default,
            },
            {
                path: 'sharing',
                name: 'sharing',
                component: require("@/content/views/person/person_mesage/sharing").default,
            },
            ]
        }]
    },
    {
        path: '/suspension',
        name: 'suspension',
        component: require('@/content/components/suspension').default
    },
    {
        path: '/resource',
        name: 'resource',
        component: require('@/content/components/resource').default
    }
    ],
});
